package org.example.demo11_factory;

public class ShapeFactory {
    public static Shape createShape(String shapeType) throws UnsupportedShapeException {
        if ("circle".equalsIgnoreCase(shapeType)) {
            return new Circle();
        } else if ("rectangle".equalsIgnoreCase(shapeType)) {
            return new Rectangle();
        } else if ("triangle".equalsIgnoreCase(shapeType)) {
            return new Triangle();
        } else {
            throw new UnsupportedShapeException("Unsupported shape type: " + shapeType);
        }
    }
}